﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Barbar.Colonization.Model {
  public class Race : Entity, IStepExecute, IUnitLocation {
    private RaceType m_RaceType;
    private Hashtable m_Units = new Hashtable();
    private Hashtable m_Cities = new Hashtable();
    private RawMaterials m_RawMaterials = new RawMaterials();

    public RaceType RaceType {
      get { return m_RaceType; }
      protected set { m_RaceType = value; }
    }

    public RawMaterials RawMaterials {
      get { return m_RawMaterials; }
    }

    #region IStepExecute Members

    public void ExecuteStep() {
      foreach (City city in m_Cities.Values)
        city.ExecuteStep();
    }

    #endregion

    #region IUnitLocation Members

    void IUnitLocation.PlaceNewUnit(Unit unit) {
      unit.Race = this;
      m_Units.Add(unit.Id, unit);
    }

    #endregion
  }
}
